﻿using System;
using System.Collections;
using System.Reflection;

namespace EHSubmit.Model
{
    /// <summary>
    ///   发布的作业通知
    /// </summary>
    public class Goal               
    {
        private int _id;                                //标识属性               
        private string _courseid;                       //所属课程的ID
        private string _teacherid;                      //发布老师的ID
        private string _title;                          //标题
        private string _subyear;                        //所在的学年        
        private string _term;                           //所在的学期
        private string _description;                    //发布的作业描述
        private string _attachpath;                     //作业的附件路径
        private string _filetypeallowed;                //允许上传的文件类型
        private DateTime _publishtime;                  //发布时间
        private DateTime _deadline;                     //截止日期
        private DateTime _lastsubmittime;               //最近上交的作业更新时间
        private bool _isdeleted;                        //是否删除      
        private int _goalType;                          //作业类型 //0主观题 1客观题

        /// <summary>
        /// 构造函数
        /// </summary>
        public Goal() 
        {
            this.Init();
        }

        /// <summary>
        /// 作业通知初始化
        /// </summary>
        /// <returns>初始化后返回真</returns>
        public bool Init()
        {
            this._id = 0;                                         //标识属性               
            this._courseid = string.Empty;                        //所属课程的ID
            this._teacherid = string.Empty;                       //发布老师的ID
            this._title = string.Empty;                           //标题
            this._subyear = string.Empty;                         //所在的学年        
            this._term = string.Empty;                            //所在的学期
            this._description = string.Empty;                     //发布的作业描述
            this._attachpath = string.Empty;                      //作业的附件路径
            this._filetypeallowed = string.Empty;                 //允许上传的文件类型
            this._publishtime = DateTime.Now;                     //发布时间ss
            this._deadline = DateTime.Now;                        //截止日期
            this._lastsubmittime = DateTime.Now;                  //最近上交的作业更新时间
            this._isdeleted = false;                              //是否删除
            this._goalType = 0;                                   //默认为主观题  
            return true;
        }

        public Goal(int _id, string _courseid, string _teacherid, string _title, string _subyear, string _term, string _description, string _attachpath, string _filetypeallowed, DateTime _publishtime, DateTime _deadline, DateTime _lastsubmittime, bool _isdeleted)
        {
            this._id = _id;
            this._courseid = _courseid;
            this._teacherid = _teacherid;
            this._title = _title;
            this._subyear = _subyear;
            this._term = _term;
            this._description = _description;
            this._attachpath = _attachpath;
            this._filetypeallowed = _filetypeallowed;
            this._publishtime = _publishtime;
            this._deadline = _deadline;
            this._lastsubmittime = _lastsubmittime;
            this._isdeleted = _isdeleted;
        }


        #region 作业通知的属性

        /// <summary>
        /// 作业通知ID
        /// </summary>
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// 所属课程的ID                                  
        /// </summary>                        
        public string CourseID                 
        {                                      
            get { return _courseid; }              
            set { _courseid = value; }         
        }  
                                  
        /// <summary>
        /// 发布老师的ID
        /// </summary>
        public string TeacherID                
        {                                      
            get { return _teacherid; }         
            set { _teacherid = value; }        
        }  
                           
        /// <summary>
        /// 标题
        /// </summary>
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        /// <summary>
        /// 所在的学年
        /// </summary>
        public string SubYear
        {
            get { return _subyear; }
            set { _subyear = value; }
        }

        /// <summary>
        /// 所在的学期
        /// </summary>
        public string Term
        {
            get { return _term; }
            set { _term = value; }
        }

        /// <summary>
        /// 发布的作业描述
        /// </summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        /// <summary>
        /// 作业的附件路径
        /// </summary>
        public string AttachPath
        {
            get { return _attachpath; }
            set { _attachpath = value; }
        }
        /// <summary>
        /// 允许上传的文件类型
        /// </summary>
        public string FileTypeAllowed
        {
            get { return _filetypeallowed; }
            set { _filetypeallowed = value; }
        }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime PublishTime
        {
            get { return _publishtime; }
            set { _publishtime = value; }
        }

        /// <summary>
        /// 截止日期
        /// </summary>
        public DateTime DeadLine
        {
            get { return _deadline; }
            set { _deadline = value; }
        }

        /// <summary>
        /// 最近上交的作业更新时间
        /// </summary>
        public DateTime LastSubmitTime
        {
            get { return _lastsubmittime; }
            set { _lastsubmittime = value; }
        }

        /// <summary>
        /// 是否删除,默认为未删除
        /// </summary>
        public bool IsDeleted
        {
            get { return _isdeleted; }
            set { _isdeleted = value; }
        }
        public int GoalType
        {
            get { return _goalType; }
            set { _goalType = value; }
        }
        #endregion
    }

}